
// api/weatherApi.js

export async function fetchWeatherData() {
  try {
    const response = await fetch("http://114.132.177.63/weather/query");
    const data = await response.json();
    return data; // 返回从后端获取的天气数据
  } catch (error) {
    console.error("Error fetching weather data:", error);
    throw error;
  }
}